package com.oversea.service.impl;

import org.hibernate.Query;
import com.oversea.models.Course;
import com.oversea.service.CourseService;

public class CourseServiceImpl extends CommonServiceImpl<Course> implements
		CourseService {

	public Course getCourseByName(String name) {
		String hql = "from Course where deleted = ? and chineseName like '%"
				+ name + "'%";
		Query query = getSession().createQuery(hql);
		query.setBoolean(0, false);
		query.setString(1, name);
		return (Course) query.uniqueResult();
	}

}
